System and Method for Queuing Work within a Virtualized Scheduler Based on In-Unit Accounting of In-Unit Entries

ABSTRACT

A system and corresponding method queue work within a virtualized scheduler based on in-unit accounting (IUA) of in-unit entries (IUEs). The system comprises an IUA resource and arbiter. The IUA resource stores, in association with an IUA identifier, an IUA count and threshold. The IUA count represents a global count of work-queue entries (WQEs) that are associated with the IUA identifier and occupy respective IUEs of an IUE resource. The IUA threshold limits the global count. The arbiter retrieves the IUA count and threshold from the IUA resource based on the IUA identifier and controls, as a function of the IUA count and threshold, whether a given WQE from a given scheduling group, assigned to the IUA identifier, is moved into the IUE resource to be queued for scheduling. The IUA count and threshold prevent group(s) assigned to the IUA identifier from using more than an allocated amount of IUEs.

BACKGROUND

Peripheral component interconnect (PCI) express, also known as “PCIe,”is a high-speed hardware interface for connecting to peripheral devices,such as a network interface controller (NIC) or another device. A singleroot I/O virtualization (SR-IOV) interface is an extension to the PCIespecification. SR-IOV allows a device, such as the NIC or other device,to separate access to its resources among various PCIe hardwarefunctions, namely, a PCIe physical function (PF) and one or more PCIevirtual functions (VFs). A PF is the primary function of the device andadvertises the device's SR-IOV capabilities. The PF is associated with aparent partition of a hypervisor in a virtualized environment.

The virtualized environment enables creation of multiple simulatedenvironments with dedicated resources from a single, physical hardwaresystem. The hypervisor is software that enables hardware resources ofthe physical hardware system to be separated into distinct and secureenvironments known as virtual machines (VMs). A virtual machine (VM)relies on the hypervisor's ability to separate the physical resourcesand distribute them appropriately. Each virtual function (VF) isassociated with the device's PF. A given VF shares one or more physicalresources of the device, such as memory, network port(s), etc., with thePF and other VFs on the device. Each VF is associated with a childpartition of the hypervisor in the virtualized environment.

SR-IOV enables network traffic to bypass a software switch layer of avirtualization stack of the hypervisor. Because a VF is assigned to achild partition, network traffic may flow directly between the VF andchild partition. As a result, an input/output (I/O) overhead in asoftware emulation layer is diminished and achieves network performancethat is nearly the same performance as in a non-virtualized environment.For example, an operating system (OS) may have access to multiple VFs,e.g., for a NIC. To improve performance, the OS may delegate ownershipof a VF to a user-space application, and allow that application todirectly interact with physical hardware resources through that VF. Inthis case, the application performance can be much higher, since theapplication can interact directly with the hardware without the overheadof communication through the OS. SR-IOV allows the OS to delegatepartial access to the hardware to an application while the rest of thehardware can be accessed directly by the OS, and/or be delegated toother applications.

A scheduler that supports scheduling of work to a VM, application, PF,or VF within the virtualized environment, supports hardwarevirtualization, and may be referred to as a “virtualized” scheduler. Thework that is scheduled may include, for example, a packet processingoperation(s) to be performed on a packet or a portion thereof. Thepacket may have been received, for example, from the NIC or other devicevia a hardware interface, such as a PCIe hardware interface, or anyother hardware interface.

SUMMARY

According to an example embodiment, a system queues work within avirtualized scheduler based on in-unit accounting (IUA) of in-unitentries (IUEs). The system comprises an IUA resource and arbiter. TheIUA resource is configured to store, in association with an IUAidentifier, an IUA count and IUA threshold. The IUA count represents aglobal count of work-queue entries (WQEs) that are associated with theIUA identifier and occupy respective IUEs of an in-unit entry (IUE)resource. The IUA threshold is set to limit the global count. Thearbiter is configured to retrieve the IUA count and IUA threshold fromthe IUA resource, based on the IUA identifier, and to control, as afunction of the IUA count and IUA threshold retrieved, whether a givenwork-queue entry (WQE) from a given scheduling group, assigned to theIUA identifier, is moved into the IUE resource to be queued forscheduling by the virtualized scheduler.

A plurality of scheduling groups may be assigned to the IUA identifier,wherein the plurality of scheduling groups includes the given schedulinggroup.

The IUA identifier may correspond to a virtual machine, an application,or a physical function (PF) or virtual function (VF) associated with asingle root I/O virtualization (SR-IOV) interface.

The virtualized scheduler may include a work scheduler configured toaccess the IUE resource. The arbiter may be further configured to movethe given WQE from a given per-group transitory admission queue (TAQ)into a given per-group in-unit admission queue (IAQ) in the IUE resourceto be queued for scheduling by the work scheduler. The given per-groupTAQ and the given per-group IAQ are assigned to the given schedulinggroup.

The system may further comprise a TAQ resource. The TAQ resourceincludes the given per-group TAQ that is configured to queue WQEsreceived for the given scheduling group. The IUE resource includes aplurality of IUEs. In an event the arbiter determines that the given WQEis to be moved into the IUE resource, the arbiter is further configuredto (i) allocate a free IUE of the plurality of IUEs, the free IUE to beused as a given IUE for admitting the given WQE into the IUE resource,(ii) move the given WQE from the given per-group TAQ to the given IUE,(iii) add the given IUE to a given per-group in-unit admission queue(IAQ) for the given scheduling group or associate the given IUE with thegiven scheduling group to create the given per-group IAQ for the givenscheduling group, and (iv) cause the IUA count in the IUA resource to beupdated. To cause the IUA count to be updated, the arbiter may befurther configured to cause the IUA count to be incremented.

Moving the given WQE to occupy the given IUE enables the given WQE to beavailable for scheduling by a work scheduler of the virtualizedscheduler. In an event the work scheduler determines that the given WQEis to be scheduled, the work scheduler is configured to assign the givenWQE to a given workslot of a plurality of workslots.

In an event the given WQE is assigned to the given workslot, and workassociated with the given WQE is completed, the work scheduler may befurther configured to free the given IUE for reuse and either the workscheduler, or the arbiter, may be further configured to cause the IUAcount in the IUA resource to be decremented.

The IUA threshold may be a maximum value for the IUA count and mayrepresent a maximum number of IUEs in the IUE resource that arepermitted to be occupied by respective WQEs from among all schedulinggroups assigned to the IUA identifier.

The global count of WQEs may be a total number of all admitted,conflicted, scheduled, and descheduled WQEs that are associated with theIUA identifier and occupy respective IUEs of the plurality of IUEs.

To control whether the given WQE is moved, the arbiter may be furtherconfigured to implement an IUA test and, based on a positive result forthe IUA test implemented, further configured to move the given WQE froma given per-group transitory admission queue (TAQ), assigned to thegiven scheduling group, and into the IUE resource. The positive resultmay be based on determining that the IUA count is less than the IUAthreshold.

The positive result may be further based on determining that a freecount is greater than zero. The free count may be a total number ofunoccupied IUEs of a plurality of available IUEs of the plurality ofIUEs, wherein the plurality of available IUEs are available to thearbiter for moving WQEs into the IUE resource for queueing. At least oneIUE, of the plurality of IUEs, may be reserved. The plurality ofavailable IUEs may exclude the at least one IUE reserved.

The positive result may be further based on determining that a groupcount is less than or equal to a group reserved threshold. The groupcount may be a total number of IUEs, of the plurality of IUEs, that areoccupied by respective WQEs that belong to the given scheduling groupand have never been scheduled by the work scheduler. The group reservedthreshold may be a given number of reserved IUEs, of the plurality ofIUEs, that are reserved for the given scheduling group for occupancy byWQEs that belong to the given scheduling group and have never beenscheduled by the work scheduler.

A first portion of IUEs, of the plurality of IUEs, may be arranged toform a given per-group in-unit admission queue (IAQ) in the IUE resourcefor the given scheduling group. The given per-group IAQ may be createdby the arbiter by allocating free IUEs of the plurality of IUEs andmoving WQEs belonging to the given scheduling group into the free IUEsallocated. A second portion of IUEs, of the plurality of IUEs, may bearranged to form a given per-group conflict queue in the IUE resourcefor the given scheduling group. The second portion of IUEs is occupiedby respective WQEs that were moved by the work scheduler, from the givenper-group IAQ to the given per-group conflict queue, in response torespective attempts to schedule the respective WQEs. The respectiveattempts failed due to respective scheduling conflicts. As such, WQEsoccupying respective IUEs of the given per-group IAQ and given per-groupconflict queue represent the respective WQEs that belong to the givenscheduling group and have never been scheduled by the work scheduler.

The arbiter may be further configured to increment the group count in anevent the given WQE is moved into the IUE resource. In an event thegiven WQE is scheduled by the work scheduler and work associated withthe given WQE completed, either the arbiter or the work scheduler may beconfigured to decrement the group count.

The positive result may be further based on determining that a) the freecount is greater than a reserved free count, wherein the reserved freecount is counted as part of the free count, and b) a group count is lessthan a group maximum threshold.

The reserved free count may be a total number of unoccupied reservedIUEs from among reserved IUEs, of the plurality of IUEs, that arereserved for moving WQEs of respective scheduling groups into the IUEresource. The group count may be a total number of IUEs, of theplurality of IUEs, that are occupied by respective WQEs that belong tothe given scheduling group and have never been scheduled by the workscheduler. The group maximum threshold may be a maximum number of IUEs,of the plurality of IUEs, that are permitted to be occupied by WQEs thatare from the given scheduling group and that have never been scheduledby the work scheduler.

The IUE resource may include a given per-group IAQ for the givenscheduling group and a given per-group conflict queue for the givenscheduling group. The WQEs that are from the given scheduling group andthat have never been scheduled may occupy respective IUEs of: the givenper-group IAQ, given per-group conflict queue, or a combination thereof.

The positive result may be further based on determining that a groupcount is less than or equal to a group reserved threshold or that a) thefree count is greater than a reserved free count, wherein the reservedfree count is counted as part of the free count, and b) a group count isless than a group maximum threshold.

In an event the IUA count is greater than or equal to the IUA threshold,the arbiter may be further configured to disregard the given WQE fromconsideration for movement into the IUE resource.

The IUA resource may include a lookup table configured to store aplurality of respective IUA count and IUA threshold pairings eachassociated with a respective IUA identifier.

The given WQE may include an identifying pointer, a tag value, atag-type, and a group identifier. The tag value associates the given WQEwith a unique work-flow. The tag-type specifies whether the uniquework-flow is ordered, atomic, or un-ordered. The group identifiercorresponds to the given scheduling group.

According to another example embodiment, a method for queuing workwithin a virtualized scheduler is based on in-unit accounting (IUA) ofin-unit entries (IUEs). The method comprises retrieving an IUA count andIUA threshold from an IUA resource based on an IUA identifier. The IUAcount represents a global count of work-queue entries (WQEs) that areassociated with the IUA identifier and occupy respective IUEs of aplurality of IUEs of an in-unit entry (IUE) resource. The IUA thresholdis set to limit the global count. The method further comprisescontrolling, as a function of the IUA count and IUA threshold retrievedfrom the IUA resource based on the IUA identifier, whether a givenwork-queue entry (WQE) from a given scheduling group, assigned to theIUA identifier, is moved into the IUE resource to be queued forscheduling by the virtualized scheduler.

Alternative method embodiments parallel those described above inconnection with the example system embodiment.

According to another example embodiment, a virtualized schedulercomprises an in-unit accounting (IUA) resource configured to store, inassociation with an IUA identifier, an IUA count and IUA threshold. TheIUA count represents a global count of work-queue entries (WQEs) thatare associated with the IUA identifier and occupy respective in-unitentries (IUEs) of an in-unit entry (IUE) resource. The IUA threshold isset to limit the global count. The virtualized scheduler furthercomprises a work scheduler configured to schedule WQEs occupyingrespective IUEs in the IUE resource to respective workslots forprocessing by respective work processing entities assigned to therespective workslots. The virtualized scheduler further comprises anarbiter configured to retrieve the IUA count and IUA threshold from theIUA resource, based on the IUA identifier, and to control, as a functionof the IUA count and IUA threshold retrieved, whether a given work-queueentry (WQE) from a given scheduling group, assigned to the IUAidentifier, is moved into the IUE resource to be queued for schedulingby the work scheduler.

According to another example embodiment, a network services processorcomprises a plurality of processor cores and a virtualized scheduler.The virtualized scheduler includes an in-unit accounting (IUA) resource.The IUA resource is configured to store, in association with an IUAidentifier, an IUA count and IUA threshold. The IUA count represents aglobal count of work-queue entries (WQEs) that are associated with theIUA identifier and occupy respective IUEs of an in-unit entry (IUE)resource. The IUA threshold is set to limit the global count. Thevirtualized scheduler further includes an arbiter configured to retrievethe IUA count and IUA threshold from the IUA resource, based on the IUAidentifier, and to control, as a function of the IUA count and IUAthreshold retrieved, whether a given work-queue entry (WQE) from a givenscheduling group, assigned to the IUA identifier, is moved into the IUEresource to be queued for scheduling by the virtualized scheduler forprocessing by a given processor core of the plurality of processor coresor a given thread executing on the given processor core.

According to yet another example embodiment, an interface unit comprisesa network interface and a work-queue entry (WQE) generator. The WQEgenerator is configured to generate a given WQE associated with packetdata received by the network interface. The given WQE belongs to a givenscheduling group. The given scheduling group is assigned to an in-unitaccounting (IUA) identifier associated with an IUA count and IUAthreshold. The interface unit is communicatively coupled to avirtualized scheduler. The at least one WQE generator is furtherconfigured to transmit the given WQE to the virtualized scheduler to bequeued for scheduling based on the IUA count and IUA threshold.

It should be understood that example embodiments disclosed herein can beimplemented in the form of a method, apparatus, system, or computerreadable medium with program codes embodied thereon.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing will be apparent from the following more particulardescription of example embodiments, as illustrated in the accompanyingdrawings in which like reference characters refer to the same partsthroughout the different views. The drawings are not necessarily toscale, emphasis instead being placed upon illustrating embodiments.

FIG. 1A is a block diagram of an example embodiment of a system forqueuing work within a virtualized scheduler based on in-unit accounting(IUA) of in-unit entries (IUEs).

FIG. 1B is a block diagram of an example embodiment of a virtualizedscheduler.

FIG. 1C is a block diagram of an example embodiment of an admissionqueue.

FIG. 1D is a block diagram of an example embodiment of an IUE resource.

FIG. 2 is a flow diagram of an example embodiment of method for queuingwork within a virtualized scheduler based on IUA of IUEs.

FIG. 3 is a flow diagram of an example embodiment of a method fordetermining whether to move a given work entry (WQE) to an IUE resource.

FIG. 4 is a block diagram of an example embodiment of an IUA identifierassignment table and IUA tracking table.

FIG. 5 is a block diagram of an example embodiment of a work-queue entry(WQE).

FIG. 6A is a block diagram of an example embodiment of a networkservices processor in which an example embodiment may be implemented.

FIG. 6B is a block diagram of an example embodiment of an interface unitof the network services processor of FIG. 6A.

DETAILED DESCRIPTION

A description of example embodiments follows.

Modern systems use virtualized schedulers, that is, schedulers thatsupport hardware virtualization within which groups of pieces of work,for example, packet processing functions, can be assigned to differentperipheral component interconnect express (PCIe) single root I/Ovirtualization (SR-IOV) physical functions (PFs) and virtual functions(VFs). Each physical function (PF) or virtual function (VF) may beassigned one or more work groups (also referred to interchangeablyherein as scheduling groups) that include a respective collection ofpieces of work to be performed.

Generally, “work” is a software routine or handler to be performed onsome data, such as packet data. To the virtualized scheduler, work maybe represented by an opaque pointer to memory, that is, a pointer whichpoints to a data structure whose contents are not exposed at a time ofits definition. Such a pointer may be initially created by a networkinterface unit (NIX), such as the NIX 671 of FIG. 6B, disclosed furtherbelow, or by software, and may be referred to herein as a work-queuepointer (WQP). The WQP, in combination with a group identifier, tagtype, and tag, may collectively form an entry, referred to herein as awork-queue entry (WQE), such as the WQE of FIG. 5, disclosed furtherbelow.

According to an example embodiment, before work can be scheduled by avirtualized scheduler for processing by, e.g., a processor core,processor thread, or other work processing entity, the WQE needs to bemoved into an in-unit entry (IUE) of an IUE resource of the virtualizedscheduler, such as the IUE resource 112 of the virtualized scheduler 102of FIG. 1B, disclosed further below. The IUE resource and itscorresponding in-unit entries (IUEs) are referred to herein as being“in-unit” because the IUE resource and IUEs are included within thevirtualized scheduler that may be referred to as a scheduler “unit.”Such IUEs may reside in on-chip memory of a chip, such as in acontent-addressable memory (CAM), static random-access memory (SRAM), orother type of on-chip memory of the chip.

The chip may be a network services processor, such as the networkservices processor 650 of FIG. 6A, disclosed further below. Thevirtualized scheduler may be the Schedule/Sync and Order (SSO) module602 of the network services processor 650, disclosed further below, andmay use a work scheduler, such as the work scheduler 148 of FIG. 1B, inorder to schedule work to a workslot that is assigned to a processorcore, such as a processor core of the processor cores 640 a-k of FIG.6A, processing thread, or other work processing entity. The work isidentified by work-queue entries (WQEs) that occupy respective IUEs ofthe IUE resource in order to be scheduled, for example, via assignmentto a workslot by the work scheduler.

The plurality of IUEs in the IUE resource are a limited resource. Whendifferent combinations of groups of WQEs (also referred tointerchangeably herein as scheduling groups) are assigned, for example,to different SR-IOV functions, such as different PFs, VFs, or acombination thereof, it is useful to limit how many IUEs are availableto each SR-IOV function in order to prevent any given PF(s) or VF(s)from using an excessive number of IUEs and potentially starving otherPF(s) or VF(s). According to an example embodiment, a given SR-IOVfunction, such as a PF or VF, may be assigned a given in-unit accounting(IUA) identifier, such as the IUA identifier 110 of FIG. 1A, disclosedfurther below, and all work group(s) assigned to that given SR-IOVis/are assigned the given IUA identifier of the SR-IOV function.

As such, each scheduling group is assigned to an IUA identifier. The IUAidentifier may be an indicator that enables a given location(s) inmemory/memories to be accessed to read or write IUA information. Forexample, the IUA identifier may be an index that corresponds to an entryor entries in a table(s) of entries. Such an index may be an integer,memory address, offset to a memory address, pointer, or any otherelement that enables a given location(s) in memory/memories to accessed.According to an example embodiment, the IUA identifier may be acharacter or string. For example, the IUA identifier may be a label thatis associated with a given location(s) in memory/memories. According toan example embodiment, the IUA identifier may include or identify aplurality of IUA identifiers.

The IUA identifier may be assigned by firmware or a physical functiondriver during initialization. For example, firmware may be configured toassign an IUA identifier for each PF/VF, and all work groups (i.e.,scheduling groups) assigned to the same PF/VF will use the same IUAidentifier (i.e., they share resources), whereas work groups assigned todifferent PF/VFs may use different IUA identifiers to separate theirresources. According to an example embodiment, the virtualized schedulerincludes a system with an IUA resource that may be configured to store amaximum threshold for each IUA identifier and each work group (i.e.,scheduling group) may also be configured with its own reserve threshold,as disclosed further below. According to an example embodiment, thevirtualized scheduler may include a system with an arbiter, such as thearbiter 114 of the system 100 of FIG. 1A, disclosed below, that may beconfigured to determine when work items, that is, WQEs, can be movedinto the IUE resource 112 based on information included in the IUAresource 104.

FIG. 1A is a block diagram of an example embodiment of a system 100 forqueuing work within a virtualized scheduler, such as the virtualizedscheduler 102 of FIG. 1B and the Schedule/Sync and Order (SSO) module602 of FIG. 6A, disclosed further below. The system 100 is configured toqueue work based on in-unit accounting (IUA) of in-unit entries (IUEs)(not shown). The system 100 comprises an IUA resource 104 configured tostore, in association 103 with an IUA identifier 110, an IUA count 106(also referred to interchangeably herein as “IUA_CNT”) and IUA threshold108 (also referred to interchangeably herein as “IUA_THRESH”). Accordingto an example embodiment, the IUA resource 104 may include a lookuptable (not shown) that is configured to store a plurality of respectiveIUA count and IUA threshold pairings each associated with a respectiveIUA identifier. It should be understood, however, that the plurality ofrespective IUA count and IUA threshold pairings are not limited to beingstored in a lookup table.

The IUA count 106 represents a global count (not shown) of work-queueentries (WQEs) (not shown) that are associated with the IUA identifier110 and occupy respective IUEs (not shown) of an IUE resource 112. TheIUA count 106 is “global” because it represents an overall, general,count of IUEs associated with the IUA identifier 100 and is not limited,for example, to a count of WQEs that are associated with the IUAidentifier 110 and stored in a single particular queue or singleparticular type of queue. For example, counts of WQEs associated withthe IUA identifier 110 and occupying IUEs of the given per-group in-unitadmission queue (IAQ) 134 of FIG. 1B. disclosed further below, would bean example of a “local” count, as such a count is local to thatparticular per-group IAQ, that is, the given per-group IAQ 134.

Continuing with reference to FIG. 1A, the IUA threshold 108 is set tolimit the global count. The IUA threshold 108 may be set, for example,by firmware, or may be initialized by hardware. It should be understood,however, that the IUA threshold 108 is not limited to being set byfirmware or hardware. The IUA threshold 108 may be a maximum value forthe IUA count 106 and may represent a maximum number of IUEs in the IUEresource 112 that are permitted to be occupied by respective WQEs fromamong all scheduling groups (not shown) that are assigned to the IUAidentifier 110. The system 100 further comprises an arbiter 114configured to retrieve the IUA count 106 and IUA threshold 108 from theIUA resource 104, based on the IUA identifier 110, and to control, as afunction of the IUA count 106 and IUA threshold 108 retrieved, whether agiven work-queue entry (WQE) 118 from a given scheduling group 116,assigned to the IUA identifier 110, is moved into the IUE resource 112to be queued for scheduling by the virtualized scheduler.

The arbiter 114 may be configured to retrieve the IUA count 106 and IUAthreshold 108 based on the IUA identifier 110. For example, according toan example embodiment, the arbiter 114 may be communicatively coupled tothe IUA resource 104 via an arbiter-IUA-resource communications bus 105.The arbiter 114 may be configured to employ the arbiter-IUA-resourcecommunications bus 105 to read a memory location (not shown) that islocated in the IUA resource 104, wherein the IUA count 106 and IUAthreshold 108 are stored at that memory location. The memory locationmay be addressed based on the IUA identifier 110. According to anexample embodiment, the arbiter 114 may employ the arbiter-IUA-resourcecommunications bus 105 to access the IUA resource 104 in order to obtainthe IUA identifier 110 based on a group identifier (not shown) that isincluded in the given WQE 118.

For example, the IUA resource 104 may include an IUA assignment table(not shown), such as disclosed further below with regard to FIG. 4, thatincludes a mapping between the group identifier and the IUA identifier110. As such, the arbiter 114 may be further configured to retrieve theIUA identifier 110 from the IUA resource 104 based on the groupidentifier, enabling the arbiter 114 to retrieve the IUA count 106 andIUA threshold 108 from the IUA resource 104 based on the IUA identifier110.

According to an example embodiment, the arbiter 114 may include an IUAresource controller (not shown) that is configured to access the IUAresource 104 over the arbiter-IUA-resource communications bus 105 toretrieve the IUA count 106 and IUA threshold 108 based on the IUAidentifier 110. For example, the IUA resource controller may beconfigured to retrieve the IUA identifier 110 from the IUA resource 104based on the group identifier of the WQE 118 and to retrieve the IUAcount 106 and IUA threshold 108 from the IUA resource 104 based on theIUA identifier 110. The IUA resource controller may be furtherconfigured to update the IUA count 106 associated with the IUAidentifier 110 based on the group identifier and a command received fromthe arbiter 114. For example, the command may instruct the IUE resourcecontroller to increment or decrement the IUA count 106 and may includethe group identifier. The IUA resource controller may be configured touse the group identifier to retrieve the IUA identifier 110 in order toaddress the memory location at which the IUA count 106 is stored in theIUA resource 104 and update (e.g., increment or decrement) the IUA count106. According to an example embodiment, the IUA resource controller maybe included in the arbiter 114, external to the arbiter 114 and usedexclusively by the arbiter 114, or may be external to the arbiter 114and shared by the arbiter 114 and a work scheduler, such as disclosedfurther below with regard to FIG. 1B.

Continuing with reference to FIG. 1A, according to an exampleembodiment, a plurality of scheduling groups 120 may be assigned to theIUA identifier 110. The plurality of scheduling groups 120 includes thegiven scheduling group 116. The IUA identifier 110 may correspond to avirtual machine (not shown), an application (not shown), or a physicalfunction (PF) (not shown) or virtual function (VF) (not shown)associated with a single root I/O virtualization (SR-IOV) interface (notshown). As such, the IUA identifier 110 may be shareable amongst theplurality of scheduling groups 120 that include work for scheduling bythe virtualized scheduler, such as the virtualized scheduler of FIG. 1B,disclosed below.

FIG. 1B is a block diagram of an example embodiment of a virtualizedscheduler 102 that includes elements of the system 100 of FIG. 1A,disclosed above. The virtualized scheduler 102 may be referred tointerchangeably herein as a Schedule/Sync and Order (SSO) module, orsimply, an SSO, and may be employed as the SSO module 602 of the networkservices processor 650, disclosed further below with regard to FIG. 6Aand FIG. 6B.

Continuing with reference to FIG. 1B, when work is added 101 to thevirtualized scheduler 102, it enters an “admission queue” assigned to agroup associated with the work. Each group has a dedicated admissionqueue (not shown) that is split between a transitory admission queue(TAQ) and an in-unit admission queue (IAQ), as disclosed below withregard to FIG. 1C.

FIG. 1C is a block diagram of an example embodiment of a given per-groupadmission queue 135. The given per-group admission queue 135 isdedicated to a given scheduling group, such as the given schedulinggroup 116 of FIG. 1A, disclosed above, and is split between a givenper-group TAQ 132 and given per-group IAQ 134, disclosed in more detailbelow with regard to FIG. 1B.

Referring back to FIG. 1B, the virtualized scheduler 102 includes a TAQresource 136 a that includes a plurality of per-group TAQs 131. Theplurality of per-group TAQs 131 includes the given per-group TAQ 132 ofthe given per-group admission queue 135 of FIG. 1C, disclosed above. Thevirtualized scheduler 102 further includes the IUE resource 112 thatincludes a plurality of per-group in-unit admission queues (IAQs) 138.The plurality of per-group IAQs 138 includes the given per-group IAQ 134of the given per-group admission queue 135 of FIG. 1C, disclosed above.

It should be understood that respective lengths of per-group TAQs of theplurality of per-group TAQs 131 may be dynamic. For example, arespective per-group TAQ may not exist until work for a respectivescheduling group is added to the TAQ resource 136 a and, thus, may havea respective length of zero. As WQEs are added to the respectiveper-group TAQ, its length increases, and as WQEs are removed, its lengthdecreases.

Similarly, each per-group IAQ of the plurality of per-group IAQs 138 mayhave a dynamic length and may not exist until work (i.e., WQE) for arespective scheduling group has been moved from the TAQ resource 136 ainto the IUE resource 112 by the arbiter 114. For example, the givenper-group IAQ 134 may not exist until the arbiter 114 allocates a freeIUE (not shown), from a plurality of IUEs (not shown) of the IUEresource 112, for use as a given IUE configured to store a given WQEthat is moved from the TAQ resource 136 a into the IUE resource 112 bythe arbiter 114. The arbiter 114 associates the given IUE with a givenscheduling group (not shown) to which the given WQE belongs and thegiven IUE transitions from a free state to an occupied state andrepresents an IAQ entry (not shown) of the given per-group IAQ 134 thatis then dedicated to storing WQEs of the scheduling group. For example,as additional WQEs of the given scheduling group 116 are added to theIUE resource 122, they are configured to occupy respective free IUEsthat are then appended to the given per-group IAQ 134.

According to an example embodiment, the arbiter 114 may select the freeIUA, to be occupied by a respective WQE, based on an IUE free list (notshown) that is maintained to identify free IUEs (not shown) in the IUEresource 112. The IUE free list may reside, for example, in the arbiter114 and may be maintained by the arbiter 114. It should be understood,however, that the IUE free list is not limited to being located in thearbiter 114 or to being maintained by the arbiter 114. Maintaining theIUE free list may include changing an IUE free list pointer frompointing to the given IUE, that becomes occupied, to point to a nextfree IUE (not shown) in the IUE resource 112.

The next free IUE may or may not be adjacent to the given IUE in the IUEresource 112. As WQEs for the given scheduling group are moved from theTAQ resource 136 a to the IUE resource 112, the given per-group IAQ 134may increase in length as IUEs become occupied by those WQEs and areadded to the given per-group IAQ 134. The arbiter 114 may add an IUE tothe given per-group IAQ 134 by linking the IUE to another IUE of thegiven per-group IAQ 134 to form a queue that has an order, wherein suchorder tracks an admission order of admission to the IUE resource 112 ofrespective WQEs occupying same.

According to an example embodiment, the plurality of per-group TAQs 131may be linked lists or doubly linked lists. Similarly, the plurality ofper-group IAQs 138 may be linked-lists or doubly linked lists. Accordingto an example embodiment, the plurality of per-group TAQs and per-groupIAQs 138 may operate on a first-in first-out (FIFO) basis.

In general, work is moved from the TAQ resource 136 a to the IUEresource 112 by the arbiter 114 and as work moves through the TAQresource 136 a and into the IUE resource 112, it remains ordered withineach group. Initially, work is added 101 to the TAQ resource 136 a. Suchwork may be generated and added 101, for example, by one or more of: thenetwork interface unit (NIX) 671, cryptographic accelerator unit (CPT)678, or timer unit 649 of FIG. 6B, disclosed further below, or aprocessor core, such as a processor core of the processor cores 640 a-kof FIG. 6A and FIG. 6B, disclosed further below. It should beunderstood, however, that work may be generated and added 101 by otherelements and is not limited to being generated and added by a processorcore or the network interface unit (NIX) 671, cryptographic acceleratorunit (CPT) 678, or timer unit 649 of FIG. 6B.

Continuing with reference to FIG. 1B, the TAQ resource 136 a may residein on-chip memory and may be extended in size based on an externaladmission queue (XAQ) resource 136 b that resides, for example, inoff-chip memory. According to an example embodiment, the on-chip memorymay include SRAM and the off-chip memory may include dynamic-randomaccess memory (DRAM), such as the DRAM 608 of FIG. 6A, disclosed furtherbelow. As more work is added 101 and the on-chip SRAM fills, thevirtualized scheduler 102 moves work from the on-chip portion of the TAQresource 136 a into the off-chip memory of the XAQ resource 136 b. Thevirtualized scheduler 102 can later bring that work back on-chip, thatis, back into the TAQ resource 136 a, in an event resources in the TAQresource 136 a become available.

Before work can be scheduled, it is moved from the given per-group TAQ132 of the TAQ resource 136 a and into a given per-group IAQ 134 of theIUE resource 112. The IUE resource 112 comprises a portion of theon-chip SRAM memories from which work can be scheduled to the work slots140 a-k. Each workslot of the workslots 140 a-k represents state ofrespective work for completion by a respective work processing entitythat is assigned to the workslot. The respective work processing entitymay be a processor core, such as a given processor core of the pluralityof processor cores 640 a-k of FIG. 6A, disclosed further below.Alternatively, the work processing entity may be a given processorthread that is executing on the given processor core, wherein the givenprocessor thread is assigned to the workslot. The respective workprocessing entity may request work, causing the work scheduler 148 toschedule work for the respective workslot assigned to the respectivework processing entity.

Continuing with reference to FIG. 1B, the IUE resource 112 may furtherstore data to track active work, that is, WQEs in the IUE resource 112,until it has been completed and released from the virtualized scheduler102. The IUE 112 is a limited resource which is shared by all groups(also referred to interchangeably herein as scheduling groups or workgroups).

Each group (i.e., scheduling group) has its own reserve threshold for aminimum amount of work it can place in its respective per-group IAQ—thisguarantees that a group can always schedule work at a given rateaccording to its priority. Each group also has a maximum threshold toprevent it from utilizing more than an allotted share of IUEs of the IUEresource 112. WQEs occupying respective IUEs of the IUE resource 112 maybe assigned to workslots by a work scheduler 148 of the virtualizedscheduler 102, causing such WQEs to become “scheduled” for processing bya work processing entity assigned to the corresponding workslot.

Referring to FIGS. 1A-D, the virtualized scheduler 102 includes the workscheduler 148 that is configured to access the IUE resource 112. Thearbiter 114 may be further configured to move the given WQE 118 from thegiven per-group TAQ 132 into the given per-group IAQ 134 in the IUEresource 112 to be queued for scheduling by the work scheduler 148. Thegiven per-group TAQ 132 and the given per-group IAQ 134 are assigned tothe given scheduling group 116.

The given per-group TAQ 132 is configured to queue WQEs received for thegiven scheduling group 116. The IUE resource 112 includes a plurality ofIUEs (not shown). In an event the arbiter 114 determines that the givenWQE 118 is to be moved into the IUE resource 112, the arbiter 114 may befurther configured to (i) allocate a free IUE (not shown) of theplurality of IUEs (not shown), the free IUE to be used as a given IUE(not shown) for admitting the given WQE 118 into the IUE resource 112,(ii) move the given WQE 118 from the given per-group TAQ 132 to thegiven IUE, (iii) add the given IUE to the given per-group IAQ 134 forthe given scheduling group 116 or associate the given IUE with the givenscheduling group 116 to create the given per-group IAQ 134 for the givenscheduling group 116, and (iv) cause the IUA count 106 in the IUAresource 104 to be updated. To cause the IUA count 106 to be updated,the arbiter 114 may be further configured to cause the IUA count 106 tobe incremented.

The arbiter 114 may cause the IUA count 106 to be updated in a number ofways. For example, the arbiter 114 may access the IUA count 106 in theIUA resource 104 by reading and writing the IUA count 106 via thearbiter-IUA-resource communications bus 105. In such a case, the arbiter114 may first retrieve the IUA identifier 110 from the IUA resource 104based on a group identifier (not shown) included in the WQE 118. Forexample, the arbiter 114 may retrieve the IUA identifier 110 that ismapped to the group identifier in a table (not shown) that is located inthe IUA resource 104. The arbiter 114 may then, in turn, use the IUAidentifier 110 to retrieve the IUA count 106, update the IUA count 106,and write the updated version of the IUA count 106 back to the IUAresource 104 at a location that is based on the IUA identifier 110.

Alternatively, the arbiter 114 may send a command (not shown) to an IUAresource controller 122 to update the IUA count 106. For example, thearbiter 114 may send the group identifier from the given WQE 118 to theIUA resource controller 122 along with a command (not shown) to, forexample, increment the IUA count 106. The group identifier and commandmay be sent from the arbiter 114 to the IUA resource controller 122 overan arbiter-IUA-resource-controller communications bus 107. The groupidentifier and command may be sent in any suitable way, for example, thegroup identifier may be a field of the command.

Responsive to the command, the IUA resource controller 122 may accessthe IUA resource 104 via an IUA-resource-controller-IUA-resourcecommunications bus 109 in order to retrieve the IUA identifier 110 basedon the group identifier. The IUA resource controller 122 may then, inturn, update the IUA count 106 by reading the IUA count 106 from amemory location that is based on the IUA identifier 110 and writing anupdated value for the IUA count 106 to the memory location.

When determining whether the given scheduling group 116 may move workfrom the TAQ resource 136 a to the IUE resource 112, the arbiter 114 mayretrieve IUA tracking information (not shown) that may be stored in theIUA resource 104. Such IUA tracking information may be read and/orwritten by the arbiter 114 directly, via the arbiter-IUA-communicationsbus 105 or indirectly, by sending command(s) to the IUA controller 122,disclosed above, The arbiter 114 may retrieve such tracking informationto implement an IUA test based on the IUA tracking information todetermine whether the given WQE 118 from the given scheduling group 116can be moved from the given per-group TAQ 132 of the TAQ resource 136 ato the given per-group IAQ 134 of the IUE resource 112.

To implement the IUA test, the arbiter 114 may access the IUA resource104 to look up (i.e., retrieve) the IUA identifier 110 using the groupidentifier that is unique to the given scheduling group 116. The arbiter114 may use the IUA identifier 110 to retrieve the IUA trackinginformation from the IUA resource 104, wherein the tracking informationmay include the following: GRP_CNT, RSVD_THR, MAX_THR, IUA_CNT,IUA_THRESH, and FREE_CNT, disclosed further below. Alternatively, thearbiter 114 may send the group identifier of the given WQE 118 with anIUA test command (not shown) to the IUA resource controller 122 and theIUA resource controller 122 may retrieve the IUA tracking informationfor returning to the arbiter 114 or to implement the IUA test for thearbiter 114 and return a result of the IUA test to the arbiter 114.

The arbiter 114 or IUA resource controller 122 may implement thefollowing IUA test using the tracking information to determine whetherthe given WQE 118 work from the given scheduling group 116 is permittedto be moved from the given per-group TAQ 132 to the given per-group IAQ134:

IUA result=(FREE_CNT>0 && (IUA_CNT<IUA_THRESH) &&(GRP_CNT<=RSVD_THR∥(FREE_CNT>RSVD_FREE && GRP_CNT<MAX_THR))  (1)

In an event the IUA result reflects that expression (1), disclosedabove, that is, the “IUA test,” evaluates to true, the IUA result isdetermined to be a positive result and the given WQE 118 is moved by thearbiter 114 from the given per-group TAQ 132 to the given per-group IAQ134 dedicated to the given scheduling group 116.

If, however, expression (1) evaluates to false, the arbiter 114 bypassesWQEs of the given scheduling group 116 that are present in the TAQresource 136 a, that is, present in the given per-group TAQ 132, andchecks whether another scheduling group is permitted have its WQEs movedto the IUE resource 112, based on the IUA result of expression (1) forthat scheduling group. The arbiter 114 may be configured to perform, ormay instruct the IUA resource controller 122 to perform, theabove-disclosed IUA test for each scheduling group of a plurality ofscheduling groups in a round-robin fashion or based on respectivepriorities assigned to scheduling groups of the plurality of schedulinggroups. The IUA test, disclosed above, may be implemented by the arbiter114 or IUA resource controller 122 to prevent scheduling groups fromusing more than their allocated amount of space in the IUE resource 112.In an event the IUA test is implemented by the IUA controller 122, theIUA controller 122 is configured to return the IUA result to the arbiter114.

Referring to expression (1) above, the GRP_CNT may be a total number ofIUEs (i.e., resources in the scheduler “unit”) occupied by work-queueentries (WQEs, aka “work”) belonging to a given scheduling group whereinthat work has never been scheduled. That is, the work has never beenassigned to a given workslot of a plurality of workslots 140 a-k. Thismay include all work in the given per-group IAQ 134, and, optionally,all work in a “conflict queue” (CQ), such as the given per-groupconflicted queue 147 of FIG. 1D, disclosed further below, becauseconflicted work has also never been scheduled. This GRP_CNT may beincremented when work is first added to the IUE resource (in theper-group IAQ 134), and decremented when work gets scheduled (i.e.,assigned to a workslot). Such incrementing or decrementing of theGRP_CNT may be performed by the arbiter 114 or the IUA resourcecontroller 122. For example, the IUA resource controller 122 may performsuch incrementing or decrementing based on a command received from thearbiter 114 to update the GRP_CNT for the given scheduling group 116.

The RSVD_THR is a group IAQ reserve threshold and may be a number ofIUEs reserved for the given scheduling group 116. In general, thevirtualized scheduler 102 may guarantee that this many IUEs are alwaysavailable for the purpose of queuing WQEs in the given per-group IAQ 134and given per-group CQ 147 (disclosed below with regard to FIG. 1D)belonging to the given scheduling group 116. These entries are usedfirst, when adding work to the given per-group IAQ 134. That is, thein-unit accounting may be such that these “reserved” entries get countedfirst.

The MAX_THR is a group IAQ maximum threshold that may represent amaximum number of IUEs that a group may use for work that has never beenscheduled (i.e., for IAQ or CQ). The IUA identifier 110 for the givenscheduling group 116 is an in-unit accounting identifier that softwarehas programmed for the given scheduling group and determines whichIUA_CNT (also referred to interchangeably herein as an “IUA count”) andIUA_THRESH (also referred to interchangeably herein as an “IUAthreshold”) are used for the given scheduling group 116.

The IUA_CNT, that is, the IUA count 106, may be a count of work items inthe IUE resource 112 for the IUA identifier 110. This count includes allWQEs, with respective group identifiers associated with the IUAidentifier 110, that have been added to the IUE resource 112 of thevirtualized scheduler 102 and currently occupy respective IUEs of theIUE resource 112. Specifically, this count may include work in theper-group IAQ and CQ of each scheduling group assigned to the IUAidentifier 110 which has never been scheduled, as well as work that iscurrently scheduled, and work that was scheduled at least once but hassince been “descheduled.” This count may be incremented when work isfirst added to the IUE resource (i.e., in a per-group IAQ), anddecremented when work completes and the work scheduler 148 frees theIUE, enabling the IUE to be reused. The work scheduler 148 may free theIUE in response to a release 165 indication received from a workprocessing entity (not shown) that is assigned to a given workslot thatwas assigned the work.

For example, the work scheduler 148 may assign 167 a given WQE to thegiven workslot and the work processing entity assigned to the givenworkslot may send the release 165 indication based on completion of thework represented by the given WQE. The work scheduler 148 may free theIUE by updating the free list, disclosed above, or by notifying thearbiter 114 that the IUE is to be freed, thereby causing the arbiter 114to update the free list to indicate that the IUE is free for use.

Continuing with reference to expression (1), the IUA_THRESH, that is,the IUA threshold 108, is a maximum value for the IUA_CNT thatcorresponds to the IUA identifier 110. That is, the maximum number ofIUEs which may be occupied by work from all groups assigned the IUAidentifier 110.

A number of free (i.e., unoccupied) IAQ entries, also referred tointerchangeably herein as the “FREE_CNT,” is the number of IUEs whichare available to the arbiter 114 when adding IAQ entries. Typically,this is the number of IUEs which are not currently in use, i.e., do notcontain any valid work. In some cases, there may be some IUEs which donot contain work but which are being reserved for other purposes andwhich are not included in this count. For example, there may be amechanism in addition to the arbiter 114 that enables work to be addedto the IUE resource 112 without going through an IAQ, and some IUEs ofthe IUE resource 112 may be reserved for this mechanism.

The number of unused IAQ entries available for allocations within thereserve threshold (also referred to interchangeably herein as“RSVD_FREE”) is the total number of free IUEs which can only be usedwhen adding work to the IAQ for a group which is currently using lessthan its reserved threshold, i.e., where GRP_CNT<RSVD_THR. These entriesare also counted as part of FREE_CNT.

In an event the arbiter 114 determines that the IUA test result ispositive based on evaluation of expression (1), disclosed above, thearbiter 114 moves the given WQE 118 from the given per-group TAQ 132 tothe given per-group IAQ 134 which causes the given WQE 118 to occupy agiven IUE of the IUE resource 112. By occupying the given IUE, the givenWQE 118 becomes available for scheduling by the work scheduler 148 ofthe virtualized scheduler 102.

In an event the work scheduler 148 determines that the given WQE 118 isto be scheduled, the work scheduler 148 is configured to assign 167 thegiven WQE 118 to a given workslot of a plurality of workslots 140 a-k.The given workslot may correspond to a given processor core of aplurality of processor cores, such as the plurality of processor cores640 a-k of FIG. 6A, disclosed further below. Alternatively, the givenworkslot may correspond to a processing thread executing on a givenprocessor core of the plurality of processor cores 640 a-k, or any otherwork processing entity. In an event the given WQE 118 is assigned to thegiven workslot, and work associated with the given WQE 118 is completedby the work processing entity assigned to the given workslot, the workscheduler 148 may be further configured to free the given IUE for reuseand either the work scheduler 148, or the arbiter 114, may be furtherconfigured to cause the IUA count 106 in the IUA resource 104 to bedecremented.

For example, the work scheduler 148 may update the free list, disclosedabove, to indicate that the given IUE is free and may send a command(not shown). with the group identifier of the given WQE 118, to the IUAresource controller 122, via a work-scheduler-IUA-resource-controllercommunications bus 111. The IUA resource controller 122 may then, inturn, retrieve the IUA identifier 110 from the IUA resource 104 based onthe group identifier and then decrement the IUA count 106 in the IUAresource 104 based on the IUA identifier.

Alternatively, the work scheduler may retrieve the IUA identifier 110based on the group identifier via a work-scheduler-IUA-resourcecommunications bus 113, and then decrement the IUA count 106 in the IUAresource 104 based on the IUA identifier 110 by accessing the IUA count106 in the IUA resource 104 via the work-scheduler-IUA-resourcecommunications bus 113.

In general, work flowing through the virtualized scheduler 102 isadmitted to the IUE resource 112 by the arbiter 114 enabling the work tobe in-flight (i.e., scheduled) and either “descheduled” or completed bya processor core, processor thread, or other work processing entity.Work scheduled to a given work processing entity may be descheduled bythe given work processing entity in an event the given work processingentity is unable to complete the work at the time of scheduling. Suchdescheduled work may be re-scheduled at a later time in order to becompleted by the given work processing entity or another work processingentity. Such descheduled work may be queued in a given per-groupdescheduled queue, such as disclosed below with regard to FIG. 1D.

FIG. 1D is a block diagram of an example embodiment of the IUE resource112 of FIGS. 1A and 1B, disclosed above. In the example embodiment, theplurality of IUEs 143 includes free IUEs 141. The free IUEs 141 areavailable for use by the arbiter 114, disclosed above with regard toFIGS. 1A and 1B, for allocating to WQEs (not shown) that are to beadmitted to the IUE resource 112. The plurality of IUEs 143 includesIUEs with admitted work 142. Such IUEs are occupied by respective WQEs(not shown) that were moved into (e.g., admitted) the IUE resource 112by the arbiter 114. It should be understood that such WQEs occupy theirrespective IUEs until the work associated with such WQEs is completed orotherwise terminated, in which case the respective IUEs they occupy aresubsequently freed for reuse.

The IUEs with admitted work 142 are configured to form the plurality ofper-group IAQs 138 that include the given per-group IAQ 134. IUEs of agiven per-group IAQ of the plurality of per-group IAQs 138, such as thegiven per-group IAQ 134, are occupied by respective WQEs of a uniquegiven scheduling group that is identified by a respective groupidentifier included in the respective WQEs. The given per-group IAQ 134of the plurality of per-group IAQs 138 may be formed by linkingrespective IUEs to the given per-group IAQ 134 in order to “add” them tothe given per-group IAQ 134. For example, the given per-group IAQ may bea linked list or doubly linked list. It should be understood, however,that the plurality of per-group IAQs 138 are not limited to being linkedlists or doubly linked lists.

Following admission of a given WQE to the IUE resource 143, the givenWQE occupies a given IUE of a given per-group IAQ, such as the givenper-group IAQ 134, and is available for scheduling by the work scheduler148, disclosed above with regard to FIG. 1B. In an event the workscheduler 148 attempts to schedule the given WQE and the attempt fails,the work scheduler 148 may alter metadata (not shown) of its respectiveIUE, causing its respective IUE to be “moved” from the IUEs withadmitted work 142 to the IUEs with conflicted work 144. It should beunderstood that the IUE is not physically “moved.” Rather, the IUE ismodified to designate that is occupied by a respective WQE that hasconflict and to disassociate the IUE from given pre-group IAQ, thereby“removing: the IUE from the IUEs with admitted work 142.

As an IUE from the IUEs with conflicted work 144, the IUE may be amember of a given per-group conflict queue 147 of a plurality ofper-group conflict queues 146. Alternatively, the IUE with conflictedwork may be a non-queued IUE with conflicted work of a plurality ofnon-queued IUEs with conflicted work 151. Such a non-queued IUE withconflicted work may have to wait to be added to a per-group conflictqueue.

In an event a conflict that is associated with a respective WQE,occupying a given IUE of the IUEs with conflicted work 144, is cleared,the work scheduler 148 may schedule the respective WQE by assigning itto a workslot and the given IUE may be “moved” to the IUEs withscheduled work 149. It should be understood that the given IUE is notphysically moved and that the content thereof is not physically moved.The given IUE is, however, altered to indicate the assigned workslot forthe respective WQE.

Similarly, in an event the work scheduler 148 schedules a given WQEoccupying a respective IUE of the IUEs with admitted work 142, the workscheduler 148 assigns it to a workslot and alters metadata (not shown)of the respective IUE to indicate that the IUE is no longer linked to agiven per-group IAQ of the plurality of per-group IAQs 138, thereby“moving” the respective IUE to the IUEs with scheduled work 149.

In an event a respective WQE, occupying a given IUE of the IUEs withscheduled work 149, is scheduled by the work scheduler 148, but workassociated therewith cannot be completed by a work processing entityassigned to a given workslot that is assigned to the respective WQE, thework scheduler 148 may deschedule the respective WQE and the given IUEmay be “moved” to the IUEs with descheduled work 153. It should beunderstood that the given IUE is not physically moved and that thecontent thereof is not physically moved. The given IUE may, however, bealtered to indicate that the respective WQE occupying same has beendescheduled. The given IUE may be linked to other IUEs of the IUEs withdescheduled work 153 that are occupied by respective WQEs with a samegroup identifier as the respective WQE, thereby forming a per-groupdescheduled group 156 of the plurality of per-group descheduled queues150.

As disclosed above with regard to FIG. 1A, the IUA count 106 representsa global count of WQEs that are associated with the IUA identifier andoccupy respective IUEs of the IUE resource 112. As such, continuing withreference to FIG. 1D, the global count of WQEs may be a total number ofall IUEs with admitted work 142, IUEs with conflicted work 144, IUEswith scheduled work 149, and IUEs with descheduled work 153, that areoccupied by WQEs that are associated with the IUA identifier 110. TheWQEs that are associated with the IUA identifier 110 have respectivegroup identifiers that are assigned to the IUA identifier 110.

Referring to FIGS. 1A-D, in order to control whether the given WQE 118is moved, the arbiter 114 may be further configured to implement the IUAtest, disclosed above, and, based on a positive result for the IUA testimplemented, to move the given WQE 118 from the given per-group TAQ 132,assigned to the given scheduling group 116, and into the IUE resource112. The positive result may be based on determining that the IUA count106 is less than the IUA threshold 108, as disclosed above with regardto expression (1).

The positive result may be further based on determining that a freecount (referred to interchangeably herein as “FREE_CNT”) is greater thanzero, as disclosed above with regard to expression (1). The free countmay be a total number of unoccupied IUEs of a plurality of availableIUEs of the plurality of IUEs 143, wherein the plurality of availableIUEs are available to the arbiter 114 for moving WQEs into the IUEresource 112 for queueing. At least one IUE, of the plurality of IUEs,may be reserved and the plurality of available IUEs may exclude the atleast one IUE reserved. The at least one IUE may be reserved to enableWQEs to be added to the IUE resource 112, directly, without having to gobe added to a per-group IAQ by the arbiter 114.

The positive result may be further based on determining that a groupcount (referred to interchangeably herein as “GRP_CNT”) is less than orequal to a group reserved threshold (referred to interchangeably hereinas “RSVD_THR”), as disclosed above with regard to expression (1). Thegroup count may be a total number of IUEs, of the plurality of IUEs,that are occupied by respective WQEs that belong to the given schedulinggroup 116 and have never been scheduled by the work scheduler 148. Thegroup reserved threshold may be a given number of reserved IUEs, of theplurality of IUEs, that are reserved for the given scheduling group foroccupancy by WQEs that belong to the given scheduling group 116 and havenever been scheduled by the work scheduler 148.

A first portion of IUEs, of the plurality of IUEs 143, may be arrangedto form a given per-group in-unit admission queue (IAQ) 134 in the IUEresource 112 for the given scheduling group 116. The given per-group IAQ134 may be created by the arbiter 114 by allocating free IUEs of theplurality of IUEs 143 and moving WQEs belonging to the given schedulinggroup 116 into the free IUEs allocated. A second portion of IUEs, of theplurality of IUEs 143, may be arranged to form a given per-groupconflict queue 147 in the IUE resource 112 for the given schedulinggroup 116. The second portion of IUEs is occupied by respective WQEsthat were moved by the work scheduler 148, from the given per-group IAQ134 to the given per-group conflict queue 147, in response to respectiveattempts to schedule the respective WQEs. The respective attempts faileddue to respective scheduling conflicts. As such, WQEs occupyingrespective IUEs of the given per-group IAQ 134 and given per-groupconflict queue 147 represent the respective WQEs that belong to thegiven scheduling group 116 and have never been scheduled by the workscheduler 148.

The arbiter 114 may be further configured to increment the group countin an event the given WQE 118 is moved into the IUE resource 112. In anevent the given WQE 118 is scheduled by the work scheduler 148 and workassociated with the given WQE 118 is completed, either the arbiter 114or the work scheduler 148 may be configured to decrement the groupcount.

The positive result may be further based on determining that a) the freecount is greater than a reserved free count (referred to interchangeablyherein as “RSVD_FREE”), wherein the reserved free count is counted aspart of the free count, and b) the group count is less than a groupmaximum threshold (referred to interchangeably herein as “MAX_THR”), asdisclosed above with regard to expression (1).

The reserved free count may be a total number of unoccupied reservedIUEs from among reserved IUEs, of the plurality of IUEs 143, that arereserved for moving WQEs of respective scheduling groups into the IUEresource 112. The group count may be a total number of IUEs, of theplurality of IUEs, that are occupied by respective WQEs that belong tothe given scheduling group 116 and have never been scheduled by the workscheduler 148. The group maximum threshold may be a maximum number ofIUEs, of the plurality of IUEs 143, that are permitted to be occupied byWQEs that are from the given scheduling group 116 and that have neverbeen scheduled by the work scheduler 148.

The IUE resource 112 may include the given per-group IAQ 134 for thegiven scheduling group 116 and the given per-group conflict queue 147for the given scheduling group 116. The WQEs that are from the givenscheduling group 116 and that have never been scheduled may occupyrespective IUEs of: the given per-group IAQ 134, given per-groupconflict queue 147, or a combination thereof.

The positive result may be further based on determining that the groupcount is less than or equal to the group reserved threshold or that a)the free count is greater than the reserved free count, wherein thereserved free count is counted as part of the free count, and b) thegroup count is less than the group maximum threshold, as disclosed abovewith regard to expression (1).

In an event the IUA count 106 is greater than or equal to the IUAthreshold 108, the arbiter 114 may be further configured to disregardthe given WQE 118 from consideration for movement into the IUE resource112.

FIG. 2 is a flow diagram 200 of an example embodiment of method forqueuing work within a virtualized scheduler based on in-unit accounting(IUA) of in-unit entries (IUEs). The method begins (202) and retrievesan IUA count and IUA threshold from an IUA resource based on an IUAidentifier, the IUA count representing a global count of work-queueentries (WQEs) that are associated with the IUA identifier and occupyrespective IUEs of a plurality of IUEs of an in-unit entry (IUE)resource, the IUA threshold set to limit the global count (204). Themethod further comprises controlling, as a function of the IUA count andIUA threshold retrieved from the IUA resource based on the IUAidentifier, whether a given WQE from a given scheduling group, assignedto the IUA identifier, is moved into the IUE resource to be queued forscheduling by the virtualized scheduler (206), and the method thereafterends (208) in the example embodiment.

FIG. 3 is a flow diagram 300 of an example embodiment of a method fordetermining whether to move a given work (WQE) to an IUE resource. Themethod may be implemented by the arbiter 114 of FIG. 1A and FIG. 1B,disclosed above. The method prevents scheduling group(s) assigned to asame IUA identifier from using more than an allocated amount of IAQresources within the IUE resource.

The method begins (302) and checks whether the FREE_CNT, disclosedabove, is greater than zero (304). If the FREE_CNT is not greater thanzero, the given WQE is not moved (306), thereby preventing schedulinggroup(s) assigned to the IUA identifier from using more than anallocated amount of IAQ resources, and the method thereafter ends (308),in the example embodiment.

If, however it is determined at (304) that the FREE_CNT is greater thanzero, the method checks for whether the IUA_CNT (i.e., IUA count) isless than the IUA_THRESH (i.e., IUA threshold) (310). If it isdetermined that the IUA_CNT is not less than the IUA_THRESH, the givenWQE is not moved (306), thereby preventing scheduling group(s) assignedto the IUA identifier from using more than an allocated amount of IAQresources, and the method thereafter ends (308), in the exampleembodiment.

If, however, it is determined at (310) that the IUA_CNT is less than theIUA_THRESH, the method checks for whether the GRP_CNT is less than orequal to the RSVD_THR (312). If it is determined that the GRP_CNT isless than or equal to the RSVD_THR, the given WQE is moved to the IUEresource (314), the IUA_CNT is incremented (320), and the methodthereafter ends (308) in the example embodiment.

If, however, it is determined at (312) that the GRP_CNT is not less thanor equal to the RSVD_THR, the method checks for whether the FREE_CNT isgreater than the RSVD_FREE (312). If it is determined that the FREE_CNTis not greater than the RSVD_FREE, the given WQE is not moved (306),thereby preventing scheduling group(s) assigned to the IUA identifierfrom using more than an allocated amount of IAQ resources, and themethod thereafter ends (308), in the example embodiment.

If, however, it is determined at (316) that the FREE_CNT is greater thanthe RSVD_FREE, the method checks for whether the GRP_CNT is less thanthe MAX_THR (318). If it is determined that the GRP_CNT is less than theMAX_THR, the given WQE is moved to the IUE resource (314), the IUA_CNTis incremented (320), and the method thereafter ends (308) in theexample embodiment.

If, however, it is determined at (318) that the GRP_CNT is not less thanthe MAX_THR, the given WQE is not moved (306), thereby preventingscheduling group(s) assigned to the IUA identifier from using more thanan allocated amount of IAQ resources, and the method thereafter ends(308), in the example embodiment.

FIG. 4 is a block diagram of an example embodiment of an IUA identifierassignment table 421 and IUA tracking table 423. The IUA identifierassignment table 421 and IUA tracking table 423 may be included in theIUA resource 104, disclosed above. The IUA identifier assignment table421 may include mappings between scheduling groups and IUA indices. Forexample, in the example embodiment, a group identifier 417 is assignedto the IUA identifier 410. WQEs that are assigned to a given group (notshown) identified by the group identifier 417 may be configured toinclude the group identifier 417. The arbiter 114, disclosed above, mayuse the group identifier 417, that may be included in that given WQE118, to retrieve the IUA identifier 410.

The IUA identifier 410 may be assigned to a given IUA tracking entry 429located in the IUA tracking table 423. The arbiter 114 may use the IUAidentifier 410 to retrieve the IUA count 406 and IUA threshold 408 fromthe IUA resource 104. Further, other IUA tracking information 411 may beretrieved from the IUA resource 104 using the group identifier 417and/or the IUA identifier 410. The tracking information 411 may include,for example, the GRP_CNT, RSVD_THR, MAX_THR, IUA_CNT, IUA_THRESH, andFREE_CNT, disclosed above, that may be used by the arbiter 114 toimplement the IUA test defined by expression (1), disclosed above. Itshould be understood, however, that the IUA tracking information 411 isnot limited to the tracking information disclosed above. Further,storing of the IUA identifier 410, IUA count 406, IUA threshold 408, andIUA tracking information 411 may be stored in other tables or multipleentries of tables and are not limited to as disclosed in FIG. 4.

FIG. 5 is a block diagram of an example embodiment of a work-queue entry(WQE) 518. The WQE 518 includes an identifying pointer, that is, the WQEpointer (WQP) 562, a tag value 564, a tag-type 566, and a groupidentifier 517. The WQE 518 may further include other WQE information568.

The tag value 564 associates the WQE 518 with a unique work-flow (notshown). The tag-type 566 specifies whether the unique work-flow isordered (ordering is guaranteed), atomic (ordering and atomicity areguaranteed), or un-ordered (no ordering is guaranteed). The groupidentifier 517 corresponds to the WQE 518 and is a unique identifierthat identifies the scheduling group to which the WQE 518 is assigned.The other WQE information 568 may link the WQE 518 to other WQEs in thescheduling group.

The tag value 564 allows the virtualized scheduler 102, disclosed above,to scheduler work for a same flow (from a source to a destination) to beordered and synchronized. For example, the tag value 564 can be a hashof the standard Transmission Control Protocol (TCP) five-tuple, that is,Internet Protocol (IP) source address, IP destination address, IPprotocol, TCP source port, TCP destination port) in the header of a datapacket defining a unique work “flow.” The same flow has the same tagvalue, so it can be ordered and synchronized. Different flows likelyhave different tag values, so will not be ordered and synchronized, andcan be executed completely in parallel on different processor cores. Thetag type 566 identifies the type of ordering and synchronization to beperformed.

As all work is not equal, different WQEs may belong to differentscheduling groups. Groups provide a means to execute different functionson different cores, even though all cores are shared by the virtualizedscheduler 102. For example, packet processing can be pipelined from onegroup of cores to another group of cores, with the first groupperforming the first stage of the work and the next group performing thenext stage of the work by defining the groups from which a processorcore will accept work. Groups allow each processor core to specify thetypes of work it will accept, allowing the work scheduler 148 todynamically distribute the work to available processor cores.

A processor core, such as any one of the processor cores disclosed belowwith regard to FIG. 6A, may request work from the work scheduler 148.Typically, the processor core polls the work scheduler 148 to find work.However, in some cases the work scheduler 148 can be selected tointerrupt the processor core when it has work for the processor core.The work scheduler 148 selects, that is, schedules the work to theprocessor core based on the groups from which the processor core acceptswork. The work scheduler 148 does not schedule a piece of work for aprocessor core if the processor core does not accept the groupassociated with the work, that is, if the processor core does not acceptWQEs with the group identifier 517 of the group.

The WQP 562 may point to WQE data (not shown) that may be stored inmemory of a network services processor, such as the network servicesprocessor 650 of FIG. 6A, disclosed further below. The work-queue datamay be a packet descriptor that describes a packet received, forexample, by the network interface unit (NIX) 671 of FIG. 6A. The packetdescriptor may include information, such as an input port that a packetarrived on, number of bytes of the packet, pointer to the packet, otherinformation based on data in fields of the packet, etc. It should beunderstood that the work-queue data is not limited to a packetdescriptor and that the packet descriptor can include information inaddition to and/or other than disclosed above.

As disclosed above, the tag type 566 may be atomic, ordered, oruntagged. With reference to FIG. 5 and FIG. 1B, disclosed above, if thetag type 566 is atomic, the work scheduler 148 will only allow one WQEwith this tag type to be active at a time. If the tag type 566 ordered,the work scheduler 148 can schedule multiple WQEs with the same tagvalue 564, but the work scheduler 148 maintains the ordering betweenthose multiple packets and, in addition, the scheduler can “switch” thetag type 566 to become atomic so that processors can determine thecorrect packet order. If the tag type 566 is untagged, the workscheduler 148 does not track any ordering for the packets. This tag type566 may be determined, e.g., by the configuration of a given queue orport of the NIX 671 that receives the packets, to match (e.g., beconsistent with) a behavior of software that will process the packets.

Work associated with different WQEs may be unrelated and can executeentirely in parallel on different cores when the WQEs have different tagvalues or tag types. WQEs associated with a same flow may have the sametag value 564, so they may be ordered and synchronized. WQEs associatedwith different flows will likely have different tag values, so willlikely not be ordered and synchronized, and can be executed completelyin parallel on different processor cores, such as the processor cores640 a-k of FIG. 6A, disclosed below.

FIG. 6A is a block diagram of an example embodiment of a networkservices processor 650 in which an example embodiment disclosed hereinmay be implemented. The network services processor 650 may process OpenSystem Interconnection network L2-L7 layer protocols encapsulated inreceived packets. As is well-known to those skilled in the art, the OpenSystem Interconnection (OSI) reference model defines seven networkprotocol layers (L1-L7). The physical layer (L1) represents the actualinterface, electrical and physical that connects a device to atransmission medium. The data link layer (L2) performs data framing. Thenetwork layer (L3) formats the data into packets. The transport layer(L4) handles end to end transport. The session layer (L5) managescommunications between devices, for example, whether communication ishalf-duplex or full-duplex. The presentation layer (L6) manages dataformatting and presentation, for example, syntax, control codes, specialgraphics and character sets. The application layer (L7) permitscommunication between users, for example, file transfer and electronicmail.

The network services processor 650 may schedule and queue work (packetprocessing operations) for upper level network protocols, for exampleL4-L7, and allow processing of upper level network protocols in receivedpackets to be performed to forward packets at wire-speed. The networkservices processor 650 may schedule and queue work for applications thatmay be restricted to lower layers, e.g., forwarding at L2 or L3 atwire-speed. Wire-speed is the rate of data transfer of the network overwhich data is transmitted and received. By processing the protocols toforward the packets at wire-speed, the network services processor 650does not slow down the network data transfer rate.

A packet is received for processing by an interface unit 663. Theinterface unit 663 performs pre-processing of the received packet bychecking various fields in the network protocol headers (e.g., L2, L3and L4 headers) included in the received packet, and may performchecksum checks for TCP/User Datagram Protocol (UDP) (L3 networkprotocols). The interface unit 663 may receive packets based on multiplenetwork interface protocols, such as Ethernet and Peripheral ComponentInterconnect Express (PCIe). In a further embodiment, the interface unit663 may be configured to receive packets from a plurality of XAttachment Unit Interfaces (XAUI), Reduced X Attachment Unit Interfaces(RXAUI), Serial Gigabit Media Independent Interfaces (SGMII), 40GBASE-R,50GBASE-R, and/or 100GBASE-R. The interface unit 663 may also prepareand transmit outgoing packets based on one or more of the aforementionedinterfaces.

The interface unit 663 may write packet data into buffers in the lastlevel cache and controller (LLC) 630 or external DRAM 608. The packetdata may be written into the buffers in a format convenient tohigher-layer software executed in at least one processor core of theprocessor cores 640 a-k. Thus, further processing of higher levelnetwork protocols is facilitated.

The network services processor 650 can also include one or moreapplication specific co-processors. These co-processors, when included,offload some of the processing from the processor cores 640 a-k, therebyenabling the network services processor 650 to achieve high-throughputpacket processing.

An I/O bridge 638 is configured to manage the overall protocol andarbitration and provide coherent I/O portioning with an I/O Bus 642. TheI/O bridge 638 may include buffer queues for storing information to betransferred between a coherent memory interconnect (CMI) 644, the I/OBus 642, and the interface unit 663. The I/O bridge 638 may comprise aplurality of individual bridges on which communications and arbitrationcan be distributed.

The miscellaneous I/O interface (MIO) 664 can include auxiliaryinterfaces such as General Purpose I/O (GPIO), Flash, IEEE 802 two-wireManagement Data I/O Interface (MDIO), Serial Management Interface (SMI),Universal Asynchronous Receiver-Transmitters (UARTs), two-wire serialinterface (TWSI), and other serial interfaces.

A Schedule/Sync and Order (SSO) module 602 queues and schedules work forthe processor cores 640 a-k. According to an example embodiment, the SSOmodule 602 is the virtualized scheduler 102, disclosed above with regardto FIG. 1A. The network service processor 650 includes a timer unit 649that may be used by the SSO module 602 to schedule work for theprocessor cores 640 a-k.

The processor cores 640 a-k may request work from the SSO module 648.The SSO module 602 selects (i.e., schedules) work for one of theprocessor cores of the processor cores 640 a-k and returns a pointer tothe work-queue entry describing the work to a given processor core ofthe processor cores 640 a-k.

Each processor core includes an instruction cache 652 and Level-1 datacache 154. In one embodiment, the network services processor 650includes 24 processor cores 640 a-k. In some embodiments, each of theprocessor cores 640 a-k may be an implementation of the Arm®architecture, such as the Armv8.2 64-bit architecture, and may becompatible with the Armv8.2 software ecosystem and include hardwarefloating point, single instruction multiple data (SIMD), and memorymanagement unit (MMU) support. In such an embodiment, consistent withthe Armv8.2 architecture, the processor cores 640 a-k may contain fullhardware support for virtualization. Guest operating systems can thusrun at Arm defined user and operating system privilege levels, andhypervisor software can run in a separate higher privilege level. Theprocessor cores 640 a-k may also support a secure state in whichsoftware may run in three different privilege levels while hardwareprovides isolation from the non-secure state. It should be understoodthat a total number of the processor cores 640 a-k is not limited to 24and that an architecture of the processor cores 640 a-k is not limitedto a 64-bit architecture or to the Armv8.2 64-bit architecture.

Last level cache and controller (LLC) 630 and external DRAM 608 areshared by all of the processor cores 640 a-k and I/O co-processordevices (not shown). Each processor core is coupled to the LLC 630 bythe CMI 644. The CMI 644 is a communication channel for all memory andI/O transactions between the processor cores 640 a-k, the I/O bridge 638and the LLC 630. In one embodiment, the CMI 644 is scalable to multiple(e.g., 24) processor cores 640 a-k, supporting fully-coherent Level-1data caches 654 with write through. The CMI 644 may be highly-bufferedwith the ability to prioritize I/O.

The controller of the LLC 630 maintains memory reference coherence. Itreturns the latest copy of a block for every fill request, whether theblock is stored in LLC 630, in external DRAM 608, or is “in-flight.” Aplurality of DRAM controllers 633 supports the external DRAM 608, andcan support preferred protocols, such as the DDR4 protocol.

After a packet has been processed by the processor cores 640 a-k, theinterface unit 663 reads the packet data from the LLC 630, DRAM 608,performs L4 network protocol post-processing (e.g., generates a TCP/UDPchecksum), forwards the packet through the interface unit 663 and freesthe LLC 630/DRAM 608 used by the packet. The DRAM Controllers 633 managein-flight transactions (loads/stores) to/from the DRAM 608.

A resource virtualization unit (RVU) 662 may enable software to mapvarious local function (LF) resources in various modules into severalphysical functions (PFs) and virtual functions (VFs). This enablesmulti-unit software drivers compatible with Linux®, Windows® and thedata plane development kit (DPDK).

A management module 626 may include various units for managing operationof the network services processor 650. For example, the managementmodule 626 may include a temperature sensor, a power serial bus masterinterface to determine current performance and energy consumption, and amemory diagnostic controller to detect and report memory errors. Themanagement module 626 may further include control processors, such as asystem control processor (not shown) for power management and othersecure chip management tasks, and a module control processor (not shown)for module management and other non-secure chip management tasks.

FIG. 6B is a block diagram of an example embodiment of the interfaceunit 663 of the network services processor 650 of FIG. 6A, disclosedabove. Transceiver module 690 transmits and receives signals inaccordance with one or more communications protocols, such as PCIe,Ethernet. Interface modules, including PCI Express interface units(PEM0-PEM3) 685, and Ethernet I/O controllers (CGX0-CGX2) 686 processreceived and outgoing signals in accordance with their respectiveprotocols. A network controller sideband interface (NCSI) unit 676provides an interface and protocol controller for a NCSI bus 677, whichprovides network packet data from/to the Ethernet I/O controllers(CGX0-CGX2) 686.

A network interface unit (NIX) 671 provides a controller (not shown) anddirect memory access (DMA) engines (not shown) to process and movenetwork packets (not shown). The NIX 671 transmits and receives packetsto and from the aforementioned interfaces modules 685, and communicateswith the SSO module 602 to schedule work for the processor cores 640 a-kto further process the packets. The NIX 671 may also communicate withthe processor cores 640 a-k to forward work in lieu of the SSO module602, and can receive packets from the processor cores 640 a-k fortransmission. The NIX 671 may include a transmit subunit (NIX-TX) (notshown) and a receive subunit (NIX-RX) (not shown), and a loopback module(LBK) 672 enables packets transmitted by the NIX-TX to be looped backand received by the NIX-RX.

The NIX 671 operates with a number of coprocessors. In particular, anetwork parser CAM unit (NPC) 673 parses network packets received for,or transmitted from, the NIX 671. A network pool allocator unit (NPA)674 may allocate and free pointers for packet, work-queue entry, senddescriptor buffers, and may support integration with a virtualizationscheme. The SSO module 602, as described above, schedules work-queueentries for NIX packets. A cryptographic accelerator unit (CPT) 678optionally decrypts Internet Protocol Security (IPsec) packets receivedby the NIX 671 and can encrypt data for outgoing packets. The interfaceunit 663 includes a PCI packet DMA unit 675 that may DMA packet databetween the NIX 671, CGX0-CGX2, PEM0-PEM3 685, or LBK 672 and the LLC630 or DRAM 608, disclosed above with regard to FIG. 6A. The interfaceunit 663 further includes a data cache (NDC0-NDC1) 679 that is a commondata cache block for use by the NIX 671 and NPA 674.

As disclosed above, the NIX 671 transmits and receives packets to andfrom the aforementioned interface modules 685, and communicates with theSSO module 602 to schedule work for the processor cores 640 a-k tofurther process the packets. According to an example embodiment, the SSOmodule 602 may be a virtualized scheduler, such as the virtualizedscheduler 102 of FIG. 1B, disclosed above. Within the SSO module 602, amethod for queueing work may be based on in-unit accounting (IUA) ofin-unit entries (IUEs), such as disclosed above with regard to FIG. 2.

Referring back to FIG. 2, the method may further comprise assigning aplurality of scheduling groups to the IUA identifier. The plurality ofscheduling groups includes the given scheduling group.

The controlling may include determining whether the given WQE is to bemoved and, in an event it is determined that the given WQE is to bemoved, the method may further comprise (i) allocating a free IUE of theplurality of IUEs, the free IUE to be used as a given IUE for admittingthe given WQE into the resource, (ii) moving the given WQE from a givenper-group transitory admission queue (TAQ) to the given IUE, (iii)adding the given IUE to a given per-group in-unit admission queue (IAQ)for the given scheduling group or associating the given IUE with thegiven scheduling group to create the given per-group IAQ for thescheduling group, and (iv) updating the IUA count in the IUA resourcebased on the IUA identifier, wherein the given per-group TAQ includesqueued WQEs received for the given scheduling group.

Updating the IUA count may include incrementing the IUA count. Movingthe given WQE to occupy the given IUE enables the given WQE to beavailable for scheduling. In an event the given WQE is scheduled, themethod may further comprise assigning the given WQE to a given workslotof a plurality of workslots.

The method may further comprise, in response to a notification that workassociated with the given WQE has been completed, freeing the given IUEfor reuse and causing the IUA count in the IUA resource to bedecremented.

The method may further comprise retrieving the global count from the IUAresource based on the IUA identifier, wherein the global count is atotal number of all admitted, conflicted, scheduled, and descheduledWQEs that are associated with the IUA identifier and occupy respectiveIUEs of the plurality of IUEs.

The controlling may include implementing an IUA test. The implementingmay include comparing the IUA count to the IUA threshold. Based on apositive result for the IUA test implemented, the method may furtherinclude moving the given WQE from a given per-group transitory admissionqueue (TAQ), assigned to the given scheduling group, and into the IUEresource. The positive result may be based on determining that the IUAcount is less than the IUA threshold as a function of the comparing.

The positive result may be further based on determining that a freecount is greater than zero. The free count may be a total number ofunoccupied IUEs of a plurality of available IUEs of the plurality ofIUEs. The plurality of available IUEs may be available to an arbiter formoving WQEs into the IUE resource for queueing.

The method may further comprise reserving at least one IUE, of theplurality of IUEs. The plurality of available IUEs may exclude the atleast one IUE reserved.

The positive result may be further based on determining that a groupcount is less than or equal to a group reserved threshold. The groupcount may be a total number of IUEs, of the plurality of IUEs, that areoccupied by respective WQEs that belong to the given scheduling groupand have never been scheduled by the virtualized scheduler. The groupreserved threshold may be a given number of reserved IUEs, of theplurality of IUEs, that are reserved for the given scheduling group foroccupancy by WQEs that belong to the given scheduling group and thathave never been scheduled by the virtualized scheduler.

The method may further comprise incrementing the group count in an eventthe given WQE is moved into the IUE resource and decrementing the groupcount in an event the given WQE is scheduled by the virtualizedscheduler and work associated with the given scheduling is completed.

The positive result may be further based on determining that a) the freecount is greater than a reserved free count, wherein the reserved freecount is counted as part of the free count, and b) a group count is lessthan a group maximum threshold. The reserved free count may be a totalnumber of unoccupied reserved IUEs from among reserved IUEs, of theplurality of IUEs, that are reserved for moving WQEs of respectivescheduling groups into the IUE resource. The group count may be a totalnumber of IUEs, of the plurality of IUEs, that are occupied byrespective WQEs that belong to the given scheduling group and have neverbeen scheduled by the virtualized scheduler. The group maximum thresholdmay be a maximum number of IUEs, of the plurality of IUEs, that arepermitted to be occupied by WQEs that are from the given schedulinggroup and that have never been scheduled by the virtualized scheduler.

The IUE resource may include a given per-group IAQ for the givenscheduling group and a given per-group conflict queue for the givenscheduling group. WQEs that are from the given scheduling group and thathave never been scheduled may occupy respective IUEs of: the givenper-group IAQ, given per-group conflict queue, or a combination thereof.

The positive result may be further based on determining that a groupcount is less than or equal to a group reserved threshold or that a) thefree count is greater than a reserved free count, wherein the reservedfree count is counted as part of the free count, and b) a group count isless than a group maximum threshold.

In an event the IUA count is greater than or equal to the IUA threshold,the method may further comprise disregarding the given WQE fromconsideration for movement into the IUE resource.

The IUA resource may include at least one lookup table. The retrievingmay include retrieving from a given lookup table of the at least onelookup table, the given lookup table storing a plurality of respectiveIUA count and IUA threshold pairings each associated with a respectiveIUA identifier.

In addition, the elements of the block and flow diagrams describedherein may be combined or divided in any manner in software, hardware,or firmware. If implemented in software, the software may be written inany language that can support the example embodiments disclosed herein.The software may be stored in any form of computer readable medium, suchas random-access memory (RAM), read only memory (ROM), compact diskread-only memory (CD-ROM), and so forth. In operation, a general purposeor application-specific processor or processing core loads and executessoftware in a manner well understood in the art. It should be understoodfurther that the block and flow diagrams may include more or fewerelements, be arranged or oriented differently, or be representeddifferently. It should be understood that implementation may dictate theblock, flow, and/or network diagrams and the number of block and flowdiagrams illustrating the execution of embodiments disclosed herein.

While example embodiments have been particularly shown and described, itwill be understood by those skilled in the art that various changes inform and details may be made therein without departing from the scope ofthe embodiments encompassed by the appended claims.

What is claimed is:
 1. A system for queuing work within a virtualizedscheduler based on in-unit accounting (IUA) of in-unit entries (IUEs),the system comprising: an IUA resource configured to store, inassociation with an IUA identifier, an IUA count and IUA threshold, theIUA count representing a global count of work-queue entries (WQEs) thatare associated with the IUA identifier and occupy respective IUEs of anin-unit entry (IUE) resource, the IUA threshold set to limit the globalcount; and an arbiter configured to retrieve the IUA count and IUAthreshold from the IUA resource, based on the IUA identifier, and tocontrol, as a function of the IUA count and IUA threshold retrieved,whether a given work-queue entry (WQE) from a given scheduling group,assigned to the IUA identifier, is moved into the IUE resource to bequeued for scheduling by the virtualized scheduler.
 2. The system ofclaim 1, wherein a plurality of scheduling groups is assigned to the IUAidentifier and wherein the plurality of scheduling groups includes thegiven scheduling group.
 3. The system of claim 1, wherein the IUAidentifier corresponds to a virtual machine, an application, or aphysical function (PF) or virtual function (VF) associated with a singleroot I/O virtualization (SR-IOV) interface.
 4. The system of claim 1,wherein the virtualized scheduler includes a work scheduler configuredto access the IUE resource, wherein the arbiter is further configured tomove the given WQE from a given per-group transitory admission queue(TAQ) into a given per-group in-unit admission queue (IAQ) in the IUEresource to be queued for scheduling by the work scheduler, and whereinthe given per-group TAQ and the given per-group IAQ are assigned to thegiven scheduling group.
 5. The system of claim 1, further comprising atransitory admission queue (TAQ) resource, the TAQ resource including agiven per-group TAQ configured to queue WQEs received for the givenscheduling group, and wherein: the IUE resource includes a plurality ofIUEs; and in an event the arbiter determines that the given WQE is to bemoved into the IUE resource, the arbiter is further configured to:allocate a free IUE of the plurality of IUEs to be used as a given IUEfor moving the given WQE into the IUE resource; move the given WQE fromthe given per-group TAQ to the given IUE; add the given IUE to a givenper-group in-unit admission queue (IAQ) for the given scheduling groupor associate the given IUE with the given scheduling group to create thegiven per-group IAQ for the given scheduling group; and cause the IUAcount in the IUA resource to be updated.
 6. The system of claim 5,wherein, to cause the IUA count to be updated, the arbiter is furtherconfigured to cause the IUA count to be incremented.
 7. The system ofclaim 5, wherein: moving the given WQE to occupy the given IUE enablesthe given WQE to be available for scheduling by a work scheduler of thevirtualized scheduler; and in an event the work scheduler determinesthat the given WQE is to be scheduled, the work scheduler is configuredto assign the given WQE to a given workslot of a plurality of workslots.8. The system of claim 7, wherein: in an event the given WQE is assignedto the given workslot and work associated with the given WQE iscompleted, the work scheduler is further configured to free the givenIUE for reuse and either the work scheduler or the arbiter is furtherconfigured to cause the IUA count in the IUA resource to be decremented.9. The system of claim 1, wherein the IUA threshold is a maximum valuefor the IUA count and represents a maximum number of IUEs in the IUEresource that are permitted to be occupied by respective WQEs from amongall scheduling groups assigned to the IUA identifier.
 10. The system ofclaim 1, wherein the IUE resource includes a plurality of IUEs andwherein the global count of WQEs is a total number of all admitted,conflicted, scheduled, and descheduled WQEs that are associated with theIUA identifier and occupy respective IUEs of the plurality of IUEs. 11.The system of claim 1, wherein, to control whether the given WQE ismoved, the arbiter is further configured to implement an IUA test and,based on a positive result for the IUA test implemented, to move thegiven WQE from a given per-group transitory admission queue (TAQ),assigned to the given scheduling group, and into the IUE resource,wherein the positive result is based on determining that the IUA countis less than the IUA threshold.
 12. The system of claim 11, wherein thepositive result is further based on determining that a free count isgreater than zero and wherein the free count is a total number ofunoccupied IUEs of a plurality of available IUEs of a plurality of IUEsof the IUE resource, the plurality of available IUEs available to thearbiter for moving WQEs into the IUE resource for queueing.
 13. Thesystem of claim 12, wherein at least one IUE, of the plurality of IUEs,is reserved and wherein the plurality of available IUEs excludes the atleast one IUE reserved.
 14. The system of claim 12, wherein the positiveresult is further based on determining that a group count is less thanor equal to a group reserved threshold and wherein: the group count is atotal number of IUEs, of the plurality of IUEs, that are occupied byrespective WQEs that belong to the given scheduling group and have neverbeen scheduled by a work scheduler of the virtualized scheduler; and thegroup reserved threshold is a given number of reserved IUEs, of theplurality of IUEs, that are reserved for the given scheduling group foroccupancy by WQEs that belong to the given scheduling group and havenever been scheduled by the work scheduler.
 15. The system of claim 14,wherein: a first portion of IUEs, of the plurality of IUEs, is arrangedto form a given per-group in-unit admission queue (IAQ) in the IUEresource for the given scheduling group, the given per-group IAQ createdby the arbiter by allocating free IUEs of the plurality of IUEs andmoving WQEs belonging to the given scheduling group into the free IUEsallocated; a second portion of IUEs, of the plurality of IUEs, isarranged to form a given per-group conflict queue in the IUE resourcefor the given scheduling group, the second portion of IUEs occupied byrespective WQEs that were moved by the work scheduler, from the givenper-group IAQ to the given per-group conflict queue, in response torespective attempts to schedule the respective WQEs, the respectiveattempts having failed due to respective scheduling conflicts; and WQEsoccupying respective IUEs of the given per-group IAQ and the givenper-group conflict queue representing the respective WQEs that belong tothe given scheduling group and have never been scheduled by the workscheduler.
 16. The system of claim 15, wherein the arbiter is furtherconfigured to increment the group count in an event the given WQE ismoved into the IUE resource and wherein, in an event the given WQE isscheduled by the work scheduler and work associated with the given WQEcompleted, either the arbiter or the work scheduler is configured todecrement the group count.
 17. The system of claim 12 wherein thepositive result is further based on determining that a) the free countis greater than a reserved free count, wherein the reserved free countis counted as part of the free count, and b) a group count is less thana group maximum threshold.
 18. The system of claim 17, wherein: thereserved free count is a total number of unoccupied reserved IUEs fromamong reserved IUEs, of the plurality of IUEs, that are reserved formoving WQEs of respective scheduling groups into the IUE resource; thegroup count is a total number of IUEs, of the plurality of IUEs, thatare occupied by respective WQEs that belong to the given schedulinggroup and have never been scheduled by the work scheduler; and the groupmaximum threshold is a maximum number of IUEs, of the plurality of IUEs,that are permitted to be occupied by WQEs that are from the givenscheduling group and that have never been scheduled by the workscheduler.
 19. The system of claim 18, wherein: the IUE resourceincludes a given per-group IAQ for the given scheduling group and agiven per-group conflict queue for the given scheduling group; and theWQEs that are from the given scheduling group and that have never beenscheduled occupy respective IUEs of: the given per-group IAQ, givenper-group conflict queue, or a combination thereof.
 20. The system ofclaim 17, wherein the positive result is further based on determiningthat a group count is less than or equal to a group reserved thresholdor that a) the free count is greater than a reserved free count, whereinthe reserved free count is counted as part of the free count, and b) agroup count is less than a group maximum threshold.
 21. The system ofclaim 1, wherein, in an event the IUA count is greater than or equal tothe IUA threshold, the arbiter is further configured to disregard thegiven WQE from consideration for movement into the IUE resource.
 22. Thesystem of claim 1, wherein the IUA resource includes a lookup tableconfigured to store a plurality of respective IUA count and IUAthreshold pairings each associated with a respective IUA identifier. 23.The system of claim 1, wherein the given WQE includes: an identifyingpointer; a tag value, the tag value associating the given WQE with aunique work-flow; a tag-type, the tag-type specifying whether the uniquework-flow is ordered, atomic, or un-ordered; and a group identifier, thegroup identifier corresponding to the given scheduling group.
 24. Amethod for queuing work within a virtualized scheduler based on in-unitaccounting (IUA) of in-unit entries (IUEs), the method comprising:retrieving an IUA count and IUA threshold from an IUA resource based onan IUA identifier, the IUA count representing a global count ofwork-queue entries (WQEs) that are associated with the IUA identifierand occupy respective IUEs of a plurality of IUEs of an in-unit entry(IUE) resource, the IUA threshold set to limit the global count; andcontrolling, as a function of the IUA count and IUA threshold retrievedfrom the IUA resource based on the IUA identifier, whether a givenwork-queue entry (WQE) from a given scheduling group, assigned to theIUA identifier, is moved into the IUE resource to be queued forscheduling by the virtualized scheduler.
 25. The method of claim 24,further comprising assigning a plurality of scheduling groups to the IUAidentifier, the plurality of scheduling groups including the givenscheduling group.
 26. The method of claim 24, wherein the IUA identifiercorresponds to a virtual machine, an application, or a physical function(PF) or virtual function (VF) associated with a single root I/Ovirtualization (SR-IOV) interface.
 27. The method of claim 24, whereinthe controlling includes determining whether the given WQE is to bemoved and, in an event it is determined that the given WQE is to bemoved, the method further comprises: allocating a free IUE of theplurality of IUEs, the free IUE to be used as a given IUE for admittingthe given WQE into the resource; moving the given WQE from a givenper-group transitory admission queue (TAQ) to the given IUE; adding thegiven IUE to a given per-group in-unit admission queue (IAQ) for thegiven scheduling group or associating the given IUE with the givenscheduling group to create the given per-group IAQ for the schedulinggroup; and updating the IUA count in the IUA resource based on the IUAidentifier, wherein the given per-group TAQ includes queued WQEsreceived for the given scheduling group.
 28. The method of claim 27,wherein updating the IUA count includes incrementing the IUA count. 29.The method of claim 27, wherein moving the given WQE to occupy the givenIUE enables the given WQE to be available for scheduling and wherein, inan event the given WQE is scheduled, the method further comprises:assigning the given WQE to a given workslot of a plurality of workslots.30. The method of claim 29, wherein the method further comprises: inresponse to a notification that work associated with the given WQE hasbeen completed, freeing the given IUE for reuse; and causing the IUAcount in the IUA resource to be decremented.
 31. The method of claim 27,wherein the IUA threshold is a maximum value for the IUA count andrepresents a maximum number of IUEs in the IUE resource that arepermitted to be occupied by respective WQEs from among all schedulinggroups assigned to the IUA identifier.
 32. The method of claim 27,wherein the method further comprises: retrieving the global count fromthe IUA resource based on the IUA identifier, wherein the global countis a total number of all admitted, conflicted, scheduled, anddescheduled WQEs that are associated with the IUA identifier and occupyrespective IUEs of the plurality of IUEs.
 33. The method of claim 27,wherein the controlling includes: implementing an IUA test, theimplementing including comparing the IUA count to the IUA threshold; andbased on a positive result for the IUA test implemented, moving thegiven WQE from a given per-group transitory admission queue (TAQ),assigned to the given scheduling group, and into the IUE resource,wherein the positive result is based on determining that the IUA countis less than the IUA threshold as a function of the comparing.
 34. Themethod of claim 33, wherein the positive result is further based ondetermining that a free count is greater than zero and wherein the freecount is a total number of unoccupied IUEs of a plurality of availableIUEs of the plurality of IUEs, the plurality of available IUEs availableto an arbiter for moving WQEs into the IUE resource for queueing. 35.The method of claim 34, further comprising reserving at least one IUE,of the plurality of IUEs, and wherein the plurality of available IUEsexcludes the at least one IUE reserved.
 36. The method of claim 33,wherein the positive result is further based on determining that a groupcount is less than or equal to a group reserved threshold and wherein:the group count is a total number of IUEs, of the plurality of IUEs,that are occupied by respective WQEs that belong to the given schedulinggroup and have never been scheduled by a work scheduler of thevirtualized scheduler; and the group reserved threshold is a givennumber of reserved IUEs, of the plurality of IUEs, that are reserved forthe given scheduling group for occupancy by WQEs that belong to thegiven scheduling group and have never been scheduled by the workscheduler.
 37. The method of claim 36, wherein: a first portion of IUEs,of the plurality of IUEs, is arranged to form a given per-group in-unitadmission queue (IAQ) in the IUE resource for the given schedulinggroup, the given per-group IAQ created by an arbiter by allocating freeIUEs of the plurality of IUEs and moving WQEs belonging to the givenscheduling group into the free IUEs allocated; a second portion of IUEs,of the plurality of IUEs, is arranged to form a given per-group conflictqueue in the IUE resource for the given scheduling group, the secondportion of IUEs occupied by respective WQEs that were moved by the workscheduler, from the given per-group IAQ to the given per-group conflictqueue, in response to respective attempts to schedule the respectiveWQEs, the respective attempts having failed due to respective schedulingconflicts; and WQEs occupying respective IUEs of the given per-group IAQand given per-group conflict queue representing the respective WQEs thatbelong to the given scheduling group and have never been scheduled bythe work scheduler.
 38. The method of claim 37, further comprising:incrementing the group count in an event the given WQE is moved into theIUE resource; and decrementing the group count in an event the given WQEis scheduled by the work scheduler and work associated with the givenWQE completed.
 39. The method of claim 34, wherein the positive resultis further based on determining that a) the free count is greater than areserved free count, wherein the reserved free count is counted as partof the free count, and b) a group count is less than a group maximumthreshold.
 40. The method of claim 39, wherein: the reserved free countis a total number of unoccupied reserved IUEs from among reserved IUEs,of the plurality of IUEs, that are reserved for moving WQEs ofrespective scheduling groups into the IUE resource; the group count is atotal number of IUEs, of the plurality of IUEs, that are occupied byrespective WQEs that belong to the given scheduling group and have neverbeen scheduled by a work scheduler of the virtualized scheduler; and thegroup maximum threshold is a maximum number of IUEs, of the plurality ofIUEs, that are permitted to be occupied by WQEs that are from the givenscheduling group and that have never been scheduled by the workscheduler.
 41. The method of claim 40, wherein the IUE resource includesa given per-group IAQ for the given scheduling group and a givenper-group conflict queue for the given scheduling group and wherein theWQEs that are from the given scheduling group and that have never beenscheduled occupy respective IUEs of: the given per-group IAQ, givenper-group conflict queue, or a combination thereof.
 42. The method ofclaim 41, wherein the positive result is further based on determiningthat a group count is less than or equal to a group reserved thresholdor that a) the free count is greater than a reserved free count, whereinthe reserved free count is counted as part of the free count, and b) agroup count is less than a group maximum threshold.
 43. The method ofclaim 24, wherein, in an event the IUA count is greater than or equal tothe IUA threshold, the method further comprises disregarding the givenWQE from consideration for movement into the IUE resource.
 44. Themethod of claim 24, wherein the IUA resource includes at least onelookup table and wherein the retrieving includes: retrieving from agiven lookup table of the at least one lookup table, the given lookuptable storing a plurality of respective IUA count and IUA thresholdpairings each associated with a respective IUA identifier.
 45. Themethod of claim 24, wherein the given WQE includes: an identifyingpointer; a tag value, the tag value associating the given WQE with aunique work-flow; a tag-type, the tag-type specifying whether the uniquework-flow is ordered, atomic, or un-ordered; and a group identifier, thegroup identifier corresponding to the given scheduling group.
 46. Avirtualized scheduler comprising: an in-unit accounting (IUA) resourceconfigured to store, in association with an IUA identifier, an IUA countand IUA threshold, the IUA count representing a global count ofwork-queue entries (WQEs) that are associated with the IUA identifierand occupy respective in-unit entries (IUEs) of an in-unit entry (IUE)resource, the IUA threshold set to limit the global count; a workscheduler configured to schedule WQEs occupying respective IUEs in theIUE resource to respective workslots for processing by respective workprocessing entities assigned to the respective workslots; and an arbiterconfigured to retrieve the IUA count and IUA threshold from the IUAresource, based on the IUA identifier, and to control, as a function ofthe IUA count and IUA threshold retrieved, whether a given work-queueentry (WQE) from a given scheduling group, assigned to the IUAidentifier, is moved into the IUE resource to be queued for schedulingby the work scheduler.
 47. A network services processor comprising: aplurality of processor cores; and a virtualized scheduler including: anin-unit accounting (IUA) resource, the IUA resource configured to store,in association with an IUA identifier, an IUA count and IUA threshold,the IUA count representing a global count of work-queue entries (WQEs)that are associated with the IUA identifier and occupy respective IUEsof an in-unit entry (IUE) resource, the IUA threshold set to limit theglobal count; and an arbiter configured to retrieve the IUA count andIUA threshold from the IUA resource, based on the IUA identifier, and tocontrol, as a function of the IUA count and IUA threshold retrieved,whether a given work-queue entry (WQE) from a given scheduling group,assigned to the IUA identifier, is moved into the IUE resource to bequeued for scheduling by the virtualized scheduler for processing by agiven processor core of the plurality of processor cores or a giventhread executing on the given processor core.
 48. An interface unit, theinterface unit comprising: a network interface; and a work-queue entry(WQE) generator configured to generate a given WQE, associated withpacket data received by the network interface, the given WQE belongingto a given scheduling group, the given scheduling group assigned to anin-unit accounting (IUA) identifier, the IUA identifier associated withan IUA count and IUA threshold, the interface unit communicativelycoupled to a virtualized scheduler, the at least one WQE generatorfurther configured to transmit the given WQE to the virtualizedscheduler to be queued for scheduling based on the IUA count and IUAthreshold.